<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>C2C-shopping-admin</title>
    <link rel="stylesheet" href="./CSS/admin.css">

</head>
<body>
<!-- 头部 -->
<div class="head">
    <div class="head1">
        <form action="AdminServelt" method="post" style="display: inline;">
            <input type="submit" name="submit" value="C2C辰" class="button_alla" />
        </form>
        <a href="./login.jsp">_shopping</a>
    </div>
    <div class="head2"></div>
    <div class="head3">
        <div class="adm_img">
            <img src="./images/userimage.jpg" alt="">
        </div>
        <div class="adm_user">
            <a href="#"><%= session.getAttribute("admid") %></a>
        </div>
    </div>
</div>

<div class="bodyc">
    <div class="bodyc_left">
        <div class="left_first">
            <a href="#">管理首页</a>
        </div>

        <div class="left_second">
            <a href="#" class="left_secondc">用户管理</a>
            <div class="left_second_menu">
                <div class="users">
                    <div class="adm_title">
                        <h1>用户管理</h1>
                        <div class="create">
                            <a href="#">新增</a>
                        </div>
                    </div>
                    <div class="adm_titleb">
                        <div class="adm_titleb_a">
                            <h2>账号</h2>
                        </div>
                        <div class="adm_titleb_b">
                            <h2>密码</h2>
                        </div>
                        <div class="adm_titleb_c">
                            <h2>邮箱</h2>
                        </div>
                        <div class="adm_titleb_d">
                            <h2>操作</h2>
                        </div>
                    </div>

                <c:forEach items="${listu }" var="us">
                    <!-- 循环体adm_all -->
                    <div class="adm_all">
                        <div class="adm_a">
                            <h3>${us.uid}</h3>
                        </div>
                        <div class="adm_b">
                            <h3>${us.upassword}</h3>
                        </div>
                        <div class="adm_c">
                            <h3>${us.umail}</h3>
                        </div>
                        <div class="adm_d">
                            <div class="button_p1">
                                <a href="#">更新</a>
                            </div>
                            <div class="button_p2">
                                <a href="AdminServelt?action=deleteu&uid=${us.uid}"  onclick="return confirm('确定要删除 ${us.uid} 用户吗？')">删除</a>
                            </div>
                        </div>
                    </div>
                </c:forEach>

                </div>

                <div class="admins">
                    <div class="adm_title">
                        <h1>管理员管理</h1>
                        <div class="create">
                            <a href="#">新增</a>
                        </div>
                    </div>
                    <div class="adm_titleb">
                        <div class="adm_titleb_a">
                            <h2>账号</h2>
                        </div>
                        <div class="adm_titleb_b">
                            <h2>密码</h2>
                        </div>
                        <div class="adm_titleb_c">
                            <h2>邮箱</h2>
                        </div>
                        <div class="adm_titleb_d">
                            <h2>操作</h2>
                        </div>
                    </div>

                <c:forEach items="${lista}" var="ad">
                    <!-- 循环体adm_all -->
                    <div class="adm_all">
                        <div class="adm_a">
                            <h3>${ad.admid}</h3>
                        </div>
                        <div class="adm_b">
                            <h3>${ad.admpassword}</h3>
                        </div>
                        <div class="adm_c">
                            <h3>${ad.admail}</h3>
                        </div>
                        <div class="adm_d">
                            <div class="button_p1">
                                <a href="#">更新</a>
                            </div>
                            <div class="button_p2">
                                <a href="AdminServelt?action=deletea&admid=${ad.admid}"  onclick="return confirm('确定要删除 ${ad.admid} 管理员吗？')">删除</a>
                            </div>
                        </div>
                    </div>
                </c:forEach>


                    
                </div>

            </div>
        </div>
    </div>

    <div class="bodyc_right">
        <div class="data">
            <div class="user_amount">
                <div class="amount_img">
                    <img src="./images/user_amount.png" alt="">
                </div>
                <div class="amount_number">
                    <h1 style="position: relative;font-size: 20px;left: -80px;">${listu[0].num}</h1>
                    <h5>用户数量</h5>
                </div>
            </div>
            <div class="admin_amount">
                <div class="amount_img" style="background-color: #57c8f2;">
                    <img src="./images/adm_amount.png" alt="">
                </div>
                <div class="amount_number " >
                    <h1 style="position: relative;font-size: 20px;left: -80px;">${lista[0].num}</h1>
                    <h5>管理数量</h5>
                </div>
            </div>
            <div class="shopa_amount">
                <div  class="amount_img" style="background-color: #ff6c60;">
                    <img src="./images/phone_amount.png" alt="">
                </div>
                <div class="amount_number">
                    <h1 style="position: relative;font-size: 20px;left: -80px;">${listp[0].num}</h1>
                    <h5>手机数量</h5>
                </div>
            </div>
            <div class="shopb_amount">
                <div class="amount_img" style="background-color: #d8e0fa;">
                    <img src="./images/3c_amount.png" alt="">
                </div>
                <div class="amount_number">
                    <h1 style="position: relative;font-size: 20px;left: -80px;">${listt[0].num}</h1>
                    <h5>配件数量</h5>
                </div>
            </div>

        </div>
        <div class="shops">
            <div class="phone">
                <div class="shop_title">
                    <h1>手机管理</h1>
                    <div class="createa" >
                        <button class="createa_b" id="createa_button">新增</button>
                    </div>
                </div>
                    <div class="phones_title">
                        <div class="phones_title_a">
                            <h2>预览图</h2>
                        </div>
                        <div class="phones_title_b">
                            <h2>名称</h2>
                        </div>
                        <div class="phones_title_c">
                            <h2>价格</h2>
                        </div>
                        <div class="phones_title_d">
                            <h2>库存数量</h2>
                        </div>
                        <div class="phones_title_e">
                            <h2>操作</h2>
                        </div>
                    </div>

                <c:forEach items="${listp}" var="ph">
                    <!-- 循环体phones_all -->
                    <div class="phones_all">
                        <div class="phones_a">
                            <img src="${ph.purl}" alt="">
                        </div>
                        <div class="phones_b">
                            <h1>${ph.pname}</h1>
                        </div>
                        <div class="phones_c">
                            <h2>${ph.pprice}</h2>
                        </div>
                        <div class="phones_d">
                            <h2>${ph.pamount}</h2>
                        </div>
                        <div class="phones_e">
                            <div class="button_p1">
                                <a href="#" onclick='document.getElementById("${ph.pid}").style.display="block";'>更新</a>
                            </div>
                            <div class="button_p2">
                                <a href="AdminServelt?action=deletep&pid=${ph.pid}" onclick="return confirm('确定要删除 ${ph.pid} 商品吗？')">删除</a>
                            </div>
                        </div>
                    </div>
                </c:forEach>



            </div>

            <div class="tool">
                <div class="shop_title">
                    <h1>3C配件管理</h1>
                    <div class="createa">
                        <a href="#">新增</a>
                    </div>
                </div>
                    <div class="phones_title">
                        <div class="phones_title_a">
                            <h2>预览图</h2>
                        </div>
                        <div class="phones_title_b">
                            <h2>名称</h2>
                        </div>
                        <div class="phones_title_c">
                            <h2>价格</h2>
                        </div>
                        <div class="phones_title_d">
                            <h2>库存数量</h2>
                        </div>
                        <div class="phones_title_e">
                            <h2>操作</h2>
                        </div>
                    </div>

                <c:forEach items="${listt}" var="to">
                    <!-- 循环体phones_all -->
                    <div class="phones_all">
                        <div class="phones_a">
                            <img src="${to.turl}" alt="">
                        </div>
                        <div class="phones_b">
                            <h1>${to.tname}</h1>
                        </div>
                        <div class="phones_c">
                            <h2>${to.tprice}</h2>
                        </div>
                        <div class="phones_d">
                            <h2>${to.tamount}</h2>
                        </div>
                        <div class="phones_e">
                            <div class="button_p1">
                                <a href="#" onclick='document.getElementById("${to.tid}").style.display="block";'>更新</a>
                            </div>
                            <div class="button_p2">
                                <a href="AdminServelt?action=deletet&tid=${to.tid}" onclick="return confirm('确定要删除 ${to.tid} 商品吗？')">删除</a>
                            </div>
                        </div>
                    </div>
                </c:forEach>



            </div>

        </div>
        <div class="footer">
            <a href="#">@C2C</a>
        </div>
    </div>
</div>

<%--新增模态框--%>
<div class="createall" id="create_div">
    <div class="which">
        <button id="phone_js" class="b1">Phone</button>
        <button id="tool_js" class="b2">Tool</button>
    </div>
    <div class="creatediv" id="creatediv_js">
    <div class="creatediv_a">
        <h1>新增手机</h1>
    </div>
    <form action="AdminServelt?action=addp" method="post" class="creatediv_f">
        <div class="creatediv_b">

            <div class="c1">
                <a href="#">Phone_Id</a>
                <input type="text" name="pid" id="pid" class="inputp">
            </div>
            <div class="c1">
                <a href="#">Phone_name</a>
                <input type="text" name="pname" id="pname" class="inputp">
            </div>
            <div class="c1">
                <a href="#">Phone_price</a>
                <input type="text" name="pprice" id="pprice" class="inputp">
            </div>
            <div class="c1">
                <a href="#">Phone_pamount</a>
                <input type="text" name="pamount" id="pamount" class="inputp">
            </div>
            <div class="c1">
                <a href="#">Phone_Url</a>
                <input type="text" name="purl" id="purl" class="inputpu">
            </div>
        </div>
        <div class="creatediv_c">
            <input type="reset" name="sure" value="返回" class="input_e" id="input_break">
            <a href="#" onclick="return confirm('新增成功')"><input type="submit" name="sure" value="创建" class="input_p"></a>
        </div>
    </form>

</div>
    <div class="createdivb" id="createdivb_js">
        <div class="creatediv_a">
            <h1>新增配件</h1>
        </div>
        <form action="AdminServelt?action=addt" method="post" class="creatediv_f">
            <div class="creatediv_b">

                <div class="c1">
                    <a href="#">Tool_Id</a>
                    <input type="text" name="tid" id="tid" class="inputp">
                </div>
                <div class="c1">
                    <a href="#">Tool_name</a>
                    <input type="text" name="tname" id="tname" class="inputp">
                </div>
                <div class="c1">
                    <a href="#">Tool_price</a>
                    <input type="text" name="tprice" id="tprice" class="inputp">
                </div>
                <div class="c1">
                    <a href="#">Tool_pamount</a>
                    <input type="text" name="tamount" id="tamount" class="inputp">
                </div>
                <div class="c1">
                    <a href="#">Tool_Url</a>
                    <input type="text" name="turl" id="trul" class="inputpu">
                </div>
            </div>
            <div class="creatediv_c">
                <input type="reset" name="sure" value="返回" class="input_e" id="input_breakb">
                <a href="#" onclick="return confirm('新增成功')"><input type="submit" name="sure" value="创建" class="input_p"></a>
            </div>
        </form>
    </div>

</div>

<c:forEach items="${listp}" var="ph">
<%--更新模态框--%>
<div class="updata" id="${ph.pid}">
<div class="updatadiv">
    <form action="AdminServelt?action=updatep" method="post" class="up_form">
        <div class="up_a">
            <h1>更新信息</h1>
        </div>
        <div class="up_b">
            <div class="up_left">
                <div class="c2">
                    <a href="#">Phone_Id</a>
                    <input type="text" name="pid" class="inputpb" value="${ph.pid}" readonly="true">
                </div>
                <div class="c2">
                    <a href="#">Phone_name</a>
                    <input type="text" name="pname" class="inputpb" value="${ph.pname}">
                </div>
                <div class="c2">
                    <a href="#">Phone_price</a>
                    <input type="text" name="pprice"  class="inputpb" value="${ph.pprice}">
                </div>
                <div class="c2">
                    <a href="#">Phone_pamount</a>
                    <input type="text" name="pamount"  class="inputpb" value="${ph.pamount}">
                </div>
            </div>
            <div class="up_right">
                <img src="${ph.purl}" alt="">
            </div>
            <div class="up_botoom">
                <a href="#">Phone_Url</a>
                <input type="text" name="purl" class="up_purl" value="${ph.purl}">
            </div>
        </div>
        <div class="up_c">
            <input type="reset" name="sure" value="返回" class="input_e" onclick='document.getElementById("${ph.pid}").style.display="none";'>
            <a href="#" onclick="return confirm('更新成功')"> <input type="submit" name="sure" value="更新" class="input_p"></a>
        </div>
    </form>
</div>

</div>
</c:forEach>

<c:forEach items="${listt}" var="to">
<%--更新模态框--%>
<div class="updata" id="${to.tid}">
    <div class="updatadiv">
        <form action="AdminServelt?action=updatet" method="post" class="up_form">
            <div class="up_a">
                <h1>更新信息</h1>
            </div>
            <div class="up_b">
                <div class="up_left">
                    <div class="c2">
                        <a href="#">Phone_Id</a>
                        <input type="text" name="tid" class="inputpb" value="${to.tid}" readonly="true">
                    </div>
                    <div class="c2">
                        <a href="#">Phone_name</a>
                        <input type="text" name="tname" class="inputpb" value="${to.tname}">
                    </div>
                    <div class="c2">
                        <a href="#">Phone_price</a>
                        <input type="text" name="tprice"  class="inputpb" value="${to.tprice}">
                    </div>
                    <div class="c2">
                        <a href="#">Phone_pamount</a>
                        <input type="text" name="tamount"  class="inputpb" value="${to.tamount}">
                    </div>
                </div>
                <div class="up_right">
                    <img src="${to.turl}" alt="">
                </div>
                <div class="up_botoom">
                    <a href="#">Phone_Url</a>
                    <input type="text" name="turl" class="up_purl" value="${to.turl}">
                </div>
            </div>
            <div class="up_c">
                <input type="reset" name="sure" value="返回" class="input_e" onclick='document.getElementById("${to.tid}").style.display="none";'>
                <a href="#" onclick="return confirm('更新成功')"> <input type="submit" name="sure" value="更新" class="input_p"></a>
            </div>
        </form>
    </div>

</div>
</c:forEach>

</body>
<script  type="text/javascript" src="./js/admin.js"></script>
</html>